package xcmg.device.infra.enums;

/**
 * @author: xiali@bkrwin.com
 * @description:
 * @date： 2019/6/12 15:42
 **/
public enum WhetherTypeEnum {
    NoFlag(0, "否"),
    YesFlag(1, "是");


    private Integer code; //编码
    private String desc; //描述

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public String getValue(int code) {
        for (WhetherTypeEnum whetherTypeEnum : WhetherTypeEnum.values()) {
            if (whetherTypeEnum.getCode().equals(code)) {
                return getDesc();
            }
        }
        return "";
    }

    WhetherTypeEnum(int code, String desc) {
        this.code = (int)code;
        this.desc = desc;
    }
}
